﻿/// <summary>
///Author: Jignesh Chaudhari
///Written: 2013-Jan 10
///Purpose: To define class properties and method
/// </summary>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TravelAgentsDesktopDBApp
{
    class ProductsSuppliers : IEquatable<ProductsSuppliers>
    {

        public int ProductSupplierId { get; set; }
        public int ProductId { get; set; }
        public int SupplierId { get; set; }

        public string ProductName { get; set; }
        public string SupplierName { get; set; }

        public override string ToString()
        {
            return string.Format("{0}: {1}", ProductName, SupplierName);
        }

        public bool Equals(ProductsSuppliers other)
        {
            if (this.ProductSupplierId == other.ProductSupplierId)
                return true;
            else return false;            
        }

        public override int GetHashCode()
        {
            return this.ProductSupplierId.GetHashCode();
        }

    }
}
